package com.zxp.plugin.controller;

/**
 * @author zxp
 * @date 2021-10-03 17:22
 */

import cn.hutool.http.HttpResponse;
import com.zxp.plugin.factory.PluginFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@Slf4j
public class IndexController {

    @Autowired
    private PluginFactory pluginFactory;

    @RequestMapping("/")
    public String index(ModelMap model, HttpServletRequest request, HttpServletResponse  response){

        model.put("havePlugins", pluginFactory.getPluginList());
        return "index";
    }


}
